%
%	TODO
%
%	ready to show page of all demos, including a couple sample
%		definition (.ray) files

\documentstyle[lslide]{article}
\pagestyle{headings}

\newlength{\foolen}
\setlength{\foolen}{\textheight}
\setlength{\textheight}{420pt} % \textwidth
\setlength{\textwidth}{\foolen}
\addtolength{\textwidth}{1.5in}
\setlength{\headsep}{0in}
\addtolength{\footskip}{-.2in}
\setlength{\headheight}{-.6in}
\input{psfigure}



%
% Uncomment this line if you don't want the CMU logo on every sheet:
% \nologo

\begin{document}

\def\footstring{1992 VASC Retreat (mwm)}
\setlength{\unitlength}{1in}

\slidehead{\centre{Rayshade \\ and the \\ Utah Raster Toolkit}}

% The figure is offset because \psfigure doesn't quite work like you'd
% expect.  The X offset is 2.1/2 -.2 (for some reason the picture shows up
% .2in to the right)

\centre{\parbox{2.1in}{\begin{picture}(2.1,2.2)
\put(.85,.05){\normalpsfigure{\figplain}{2.1in}{2.1in}{ps/bigpac.PS}}
\end{picture}}}

\begin{center}
Presented by Mark Maimone \\
\yskip 
3-5 June, 1992 \\ VASC Retreat
\end{center}
\newpage

\slidehead{What Am I Talking About?}

Too-useful public domain packages:

\begin{description}
\item[Rayshade] -- Ray tracing program
\begin{itemize}
\item Input is 3D scene description in simple text file format
\item Generates 24-bit color renderings
\end{itemize}

\item[Utah Raster Toolkit] -- Device Independent display package, ala GIL
\begin{itemize}
\item Supports image display on X11, PostScript, \LaTeX, Scribe, real GIF,
and GIL devices
\item X11 display tool truly supports color images(!), and does automatic dithering
on monochrome displays
\item Scanline-based C interface (more restrictive than GIL, but usable)
\end{itemize}

\end{description}
\newpage
\slidehead{Different Versions of Rayshade}

Rayshade is public domain code developed by many people, but most notably
Craig Kolb (cek@cs.princeton.edu).  There are three versions:

\begin{description}

\item[Rayshade 4.0] is installed on the Suns (with minor enhancements by mwm
(me); depth map, {\tt rle2gil, gil2rle}).  Original source is in {\tt
/alex/edu/princeton/pub/Graphics/rayshade.4.0/ rayshade.4.0.tar.Z}
 \item[Rayshade 4.0.6] is installed in a CS misc collection \item[Rayshade
4.0.6enh] is an ``enhanced'' version; many users' extensions were combined
into this (unsupported) package by Dave DeBry (ddebry@dsd.es.com).  This is
not installed at CMU, but you can find it in {\tt
/alex/edu/yale/math/weedeater/incoming/ray406enh.tar.Z} \end{description}

\newpage

\slidehead{Rayshade is Easy to Use!}

\parbox{1in}{\begin{picture}(1,1.1)
\put(0,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/sphere.PS}}
\end{picture}}
{\tt \% echo sphere 2 0 0 0 | rayshade > sphere.rle}

\begin{itemize}
\item Simple world model:
\parbox{184pt}{\normalpsfigure{\figplain}{184pt}{161pt}{ps/camera.Ps}}
\parbox{2.5in}{Easy to change coordinate system!}

\item Easy to distribute the rendering task across processors ({\tt -W}
command-line option crops, then use URT to combine)
\item Easy to preview (limit ray depth, crop, decrease resolution)
\end{itemize}
\newpage

\slidehead{Rayshade Examples}
\parbox{1in}{\begin{picture}(1,1.1)
\put(0,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/ap1.PS}}
\end{picture}}
\parbox{7in}{\tt sphere diffuse 1 1 0 2 0 0 0 texture marble}

\parbox{1in}{\begin{picture}(1,1.1)
\put(0,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/ap2.PS}}
\end{picture}}
\parbox{7in}{\tt aperture 2 \\ sphere diffuse 1 1 0 2 0 0 0 texture marble}


\parbox{1in}{\begin{picture}(1,1.1)
\put(0,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/mancyl.PS}}
\end{picture}}
\parbox{7in}{\tt cylinder 3 0 0 -3 0 0 3 texture image
/afs/cs/misc/rayshade/all\_mach/omega/doc/img/mandrill.rle map cylindrical}


\parbox{1in}{\begin{picture}(1,1.1)
\put(0,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/diff.PS}}
\end{picture}}
\parbox{7in}{\tt difference sphere 2 0 0 0 box 0 0 0 4 -4 4 rotate 0 1 0 45
translate 0 2 0 end}

\newpage

\slidehead{Building Objects in Rayshade}
\begin{description}
\item[Primitives] {\tt box, blob, sphere, triangle, poly{\rm gon},
heightfield, plane, cylinder, cone, disc}, arbitrary 2D images for texture
mapping
\item[CSG Objects] More complex (Constructive Solid Geometry) objects
constructed by union, intersection, difference operations.  Take care not to
build inconsistent CSG models (not all primitives enclose space, don't line
up flat surfaces exactly).
\item[Spatial Transforms] {\tt translate, rotate, scale, transform} matrix
may be applied to objects (and textures)
\item[Spatial locality] Can specify objects as lying within an
arbitrary voxel (3D grid point) for more efficient rendering.
\end{description}

\newpage
\slidehead{Heightfield Primitive}

\begin{itemize}
\item {\tt Heightfield} lets you specify a surface as a primitive (so
texture mapping is easy!)

\item Input is represented as a square (data $<$ {\tt -1000} are ignored)

\item File format is compact, but not portable.
\begin{itemize}
\item First word is 32-bit integer {\em size} of heightfield ($\sqrt{\mbox{\# data
points}}$)

\item Following size$^2$ words are 32-bit {\tt float}s ({\em very}
non-portable)
\item Data fill rows first (i.e. y-coord is fixed)
\end{itemize}
\item Data mapped into unit square on X and Y axes, but you can transform as
you like
\end{itemize}

\newpage
\slidehead{Stereo Example}
{\tt \% rayshade -l -E 1 balls.ray > left.rle \\
     \% rayshade -r -E 1 balls.ray > right.rle \\
     \% rayshade -z depth.dat balls.ray > front.rle}

\vspace{1cm}
\parbox{2in}{\begin{picture}(1,1.1)
\put(1.,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/left.PS}}
\end{picture}\\\centre{\tt left.rle}}
\parbox{2in}{\begin{picture}(1,1.1)
\put(1.,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/front.PS}}
\end{picture}\\\centre{\tt front.rle}}
\parbox{2in}{\begin{picture}(1,1.1)
\put(1.,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/right.PS}}
\end{picture}\\\centre{\tt right.rle}}
\parbox{2in}{\begin{picture}(1,1.1)
\put(1.,.05){\normalpsfigure{\figplain}{1in}{1in}{ps/depthcolor.PS}}
\end{picture}\\\centre{\tt depth.rle}}

\vspace{1em}
{\tt \% echo eyep 0 .5 -1   lookp .5 .5 -3    heightfield depth.plot texture image
front.rle | rayshade > depth.rle}
\newpage
\normalpsfigure{\figplain}{7in}{10in}{ps/depth.PS}

\slidehead{Surface Features}
\begin{itemize}
\item Uses Phong shading (two params; specular base color and Phong coeff)
\item Parameters include transparency, index of refraction, ambient lighting
(``default'' color, unaffected by rays), diffuse color
\item Builtin textures include {\tt blotch, bump} (random deltas to normal
vector), {\tt checker, cloud, fbm} (fractional Brownian motion), {\tt gloss,
marble, wood}
\item Can map arbitrary images onto objects using one of four texture
mapping schemes:  {\tt map uv} (uses builtin mapping), {\tt linear,
cylindrical, spherical}
\end{itemize}

\newpage

\slidehead{Antialiasing, Lighting}
Two types:
\begin{description}
\item[Adaptive Supersampling] Subdivides the pixel until adjacent subpixels' colors
all lie within a given threshold (or max number of subdivisions already done)
\item[Jittering] move sampling location by random amount (adds noise to
image)
\end{description}

These are combined in version 4.0.6 (available in the CS misc collection)

\begin{description}
\item[Light sources] {\tt point, directional, spotlight, spherical} options.
Shadow attenuations (through transparent objects) can be turned on or off.
\item[Gamma correction] Not really a lighting issue, but it's available.
\end{description}

\newpage
\slidehead{Differences between 4.0 and 4.0.6}

\begin{itemize}
\item 4.0 supports depth-map generation, 4.0.6 does not
\item 4.0.6 supports animation, 4.0 does not
\item 4.0.6 Guide seems to better reflect both programs, but not always
\item 4.0.6 uses both adaptive and jittered antialiasing by default
\item {\tt map linear} becomes {\tt map planar} in 4.0.6
\item Command-line {\tt -W} parameters are reversed ({\tt x y x y} in 4.0,
{\tt x x y y} in 4.0.6)
\item Substantial rewrite in 4.0.6 (more code in libraries)
\end{itemize}

\newpage

\slidehead{Performance Measurements}
\begin{itemize}

\item Rayshade produces statistics for every image it generates (CPU time,
rays fired, cache efficiency)

\item Rayshade does {\em not} run in real time, but is reasonable.  Cover
image took 20 minutes to render at 256x256, textured heightfield in stereo
example took 4 minutes at 256x256 (with two directional light sources).

\item You can tune performance for scenes with many objects by giving an
explicit {\tt grid} structure

\end{itemize}

\newpage

\slidehead{Rayshade Feature Summary}

\begin{itemize}
\item Antialiasing (adaptive sampling, jittering)
\item Depth of field (aperture, focal distance)
\item Light sources (point, infinite, spotlight, spherical)
\item CSG objects (arbitrary union, meet, difference)
\item Direct support for stereo pairs (including depth map)
\item Translucent objects, shading
\item Height field
\item Animation
\end{itemize}

\newpage
\slidehead{Problems with Rayshade}
\begin{itemize}
\item Can core dump on improper inputs, e.g. specifying a window with too
few parameters.
\item There are several competing versions (4.0, 4.0.6, 4.0.6ext);
extensions I made to 4.0 do not readily port to 4.0.6.
\item Phong shading model is outdated.
\item Does not run in real time (useless for online model-based tracking).
\end{itemize}

\newpage
\slidehead{Why use Rayshade?}
\begin{itemize}
\item Nice previewing options.
\item Can use GIL images for texture mapping, using {\tt gil2rle}
\item Can use rendered image with GIL, using {\tt rle2gil}
\item We've got source code! And it's not hard to follow
\item Generating stereo pairs is trivial, and you can get ``ground truth''
output automatically
\item Easy to restrict the image area you want to generate, and piece
together bits and pieces.
\item Growing user community (about 150 on rayshade-users list) (email {\tt
rayshade-request@cs.princeton.edu} to join the list)
\item It's free!
\end{itemize}

\newpage
\slidehead{Where to find Rayshade}

\begin{description}
\item[SunOS] Everything for version 4.0 is located in{\tt /IUS/usrc31/ray/}

\begin{description}
\item[bin/] Main executable ({\tt rayshade})
\item[doc/] DVI and PostScript guide ({\tt rayshade-guide.\{dvi,ps\}}), quick
ASCII summary of command-line options and specification grammar in {\tt
rayshade-quickref.txt}.  No man page, sorry!
\item[rayshade.4.0/] Complete source tree  (\LaTeX\ source files for the
user's guide in {\tt rayshade.4.0/Doc/Guide}).
\end{description}
You should {\tt setpath PATH -i99 /IUS/usrc31/ray/bin}.

\item[Mach] Version 4.0.6 is a misc collection for all architectures.
Rayshade is in {\tt /usr/misc/bin}, but you should {\tt setpath -i99
/usr/misc/.rayshade} to get the URT routines.  You can find the source in
{\tt /afs/cs/misc/rayshade/build/src/rayshade.4.0/}.
\end{description}


\end{document}
